<?php
	class Config
	{
		private $DB_HOST = 'localhost';
		private $DB_USER = 'root';
		private $DB_PASS = '';
		private $DB_DATABASE = 'cpse';
		
		function __construct()
		{
			mysql_connect($this->DB_HOST,$this->DB_USER,$this->DB_PASS) or die(mysql_error());
			mysql_select_db($this->DB_DATABASE) or die(mysql_error());
			mysql_query('SET NAMES "utf8"');
		}
		
		function getHost()
		{
			return $this->DB_HOST;
		}
		
		function setHost($set)
		{
			$this->DB_HOST = $set;
		}
		
		function getUser()
		{
			return $this->DB_USER;
		}
		
		function setUser($set)
		{
			$this->DB_USER = $set;
		}
		
		function getPass()
		{
			return $this->DB_PASS;
		}
		
		function setPass($set)
		{
			$this->DB_PASS = $set;
		}
				
		function getDatabase()
		{
			return $this->DB_DATABASE;
		}
		
		function setDatabase($set)
		{
			$this->DB_DATABASE = $set;
		}
		
		function setALL($host,$user,$pass,$database)
		{
			$this->DB_HOST = $host;
			$this->DB_USER = $user;
			$this->DB_PASS = $pass;
			$this->DB_DATABASE = $database;
		}
		
		function connect()
		{
			mysql_connect($this->DB_HOST,$this->DB_USER,$this->DB_PASS) or die(mysql_error());
			mysql_select_db($this->DB_DATABASE) or die(mysql_error());
			mysql_query('SET NAMES "utf8"');
		}
	}
?>